package van.planifolia.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
import van.planifolia.dao.AccountDao;
import van.planifolia.pojo.Account;
import van.planifolia.service.AccountService;
import van.planifolia.vo.LoginVo;

import javax.annotation.Resource;

/**
 * Created by Intellij IDEA<br>
 *
 * @author Planifolia.Van
 * @version 1.0
 * @date 2022/11/23 17:35
 */
@Service("accountService")
public class AccountServiceImpl implements AccountService {
    @Resource(name = "accountDao")
    AccountDao accountDao;

    @Override
    public Account getAccountByIdAndPwd(LoginVo loginVo) {
        return accountDao.selectOne(
                new QueryWrapper<Account>()
                        .eq("accountid", loginVo.getAccountId())
                        .eq("accountpwd", loginVo.getAccountPwd())
        );
    }
}
